<template>
  <view class="icon-container" @click="$emit('click')">
    <text class="icon" :style="iconStyle">{{ iconMap[type] }}</text>
  </view>
</template>

<script>
export default {
  props: {
    type: {
      type: String,
      required: true
    },
    size: {
      type: Number,
      default: 24
    },
    color: {
      type: String,
      default: '#8e8e93'
    }
  },
  data() {
    return {
      iconMap: {
        arrowleft: '←',
        arrowright: '→',
        add: '+',
        check: '✓',
        close: '×'
      }
    }
  },
  computed: {
    iconStyle() {
      return {
        fontSize: `${this.size}px`,
        color: this.color,
        lineHeight: `${this.size}px`
      }
    }
  }
}
</script>

<style scoped>
.icon-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  
  &:hover {
    opacity: 0.8;
    transform: scale(1.1);
  }
  
  &:active {
    transform: scale(0.95);
  }
}

.icon {
  font-family: Arial, sans-serif;
  font-weight: bold;
  user-select: none;
}
</style>
